From cdd39a4154ab5e6030d1765679ddaedc3d1919ca Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Thu, 1 Feb 2024 05:39:25 -0800
Subject: feat(badges): use anime rate limit card

---
 src/routes/user/[user]/+page.svelte | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)

(limited to 'src/routes/user/[user]/+page.svelte')

diff --git a/src/routes/user/[user]/+page.svelte b/src/routes/user/[user]/+page.svelte
index 5ac09aa6..f33ba801 100644
--- a/src/routes/user/[user]/+page.svelte
+++ b/src/routes/user/[user]/+page.svelte
@@ -9,6 +9,7 @@
 	import { onMount } from 'svelte';
 	import authorisedUsers from '$lib/Data/authorised.json';
 	import tooltip from '$lib/Tooltip/tooltip.js';
+	import AnimeRateLimited from '$lib/Error/AnimeRateLimited.svelte';
 
 	export let data;
 
@@ -35,24 +36,10 @@
 <HeadTitle route={`${data.username}'s Profile`} path={`/user/${data.username}`} />
 
 {#if error}
-	<div class="card popup">
-		<p>
-			<a href={`https://anilist.co/user/${data.username}`} target="_blank">@{data.username}</a>'s
-			profile could not be loaded.
-		</p>
-
-		<span> It is likely that you have been rate limited by AniList. Please try again later. </span>
-
-		{#await fetch('https://api.waifu.pics/sfw/cry') then response}
-			{#await response.json() then json}
-				<p />
-
-				<a href={`https://trace.moe/?url=${encodeURIComponent(json.url)}`} target="_blank">
-					<img src={json.url} alt="" style="width: 30vw;" />
-				</a>
-			{/await}
-		{/await}
-	</div>
+	<AnimeRateLimited>
+		<a href={`https://anilist.co/user/${data.username}`} target="_blank">@{data.username}</a>'s
+		profile could not be loaded.
+	</AnimeRateLimited>
 {:else}
 	<div class={userData ? 'card card-small' : 'card'} id="user-panel">
 		{#if userData === null}
-- 
cgit v1.2.3

